package com.zbb.jacocoserver.service;

import com.zbb.jacocoserver.controller.BuildInfoMapper;
import com.zbb.jacocoserver.model.BuildInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

@Service
public class BuildInfoService {
    @Autowired
    private BuildInfoMapper buildInfoMapper;

    public int insertSelective(BuildInfo buildInfo){
        return buildInfoMapper.insertSelective(buildInfo);
    }

    public BuildInfo selectByPrimaryKey(String id){
        return buildInfoMapper.selectByPrimaryKey(id);
    }

    public int updateSelective(BuildInfo buildInfo){
        return buildInfoMapper.updateByPrimaryKey(buildInfo);
    }

    public BuildInfo selectByBuildId(String buildId){
        Example example = new Example(BuildInfo.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("buildId",buildId);
        return buildInfoMapper.selectOneByExample(example);
    }
}
